home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / tesla / eng-form.sty < prev    next >
Text File  |  1994-07-26  |  4KB  |  109 lines

  1. %
  2. % eng-form.sty
  3. %
  4. % This is part of the TeSLa package that is the subject of the paper
  5. % entitled "An Example Special Purpose Input Language to LaTeX" that
  6. % was (will be) presented to the TUG94 conference in Santa Barabara.
  7. % Please see tesla.sty for more details.
  8. % ======================================
  9. %
  10.  
  11. %
  12. % Customization Required for [tvar.
  13. % =================================
  14. %
  15. % The English form is the second "form" used by TeSLa.  That is, the 
  16. % tabular form (the first "form") is ignored when the English form is
  17. % used.  This is implemented with the \xform command, whose arguments
  18. % are:
  19. %          #1 - The tabular form
  20. %          #2 - The English form; IGNORED in this style
  21. %
  22. % See the "The [tvar command" subsection of "The Implementation" section 
  23. % in the paper for more details.
  24. %
  25. \gdef\xform #1#2{#2}
  26.  
  27. %
  28. % Customization Required for [tgroup.
  29. % ===================================
  30. %
  31. % The \xbegin command defines the TeX formatting to be inserted at the
  32. % begining of a group of rules.  Its arguments are:
  33. %          #1 - TeX command to be used for the \trule command
  34. %          #2 - the number of conditions in each rule
  35. %          #3 - the number of columns in the table (#2 + 1)
  36. %          #4 - the width of each column
  37. %          #5 - the title for the group of rules
  38. % In this English form, we start a new LaTeX subsection.
  39. %
  40. % The \sep command defines the TeX formatting to be inserted to add
  41. % some extra separation between subgroups of a group of rules.  In
  42. % this English form, it does nothing.
  43. %
  44. % The \xend command defines the TeX formatting to be inserted at the
  45. % end of a group of rules.  In this English form, it does nothing.
  46. %
  47. % See the "The [tgroup command" subsection of "The Implementation" section
  48. % in the paper for more details.
  49. %
  50. \gdef\xbegin#1#2#3#4#5{
  51.     \gdef\trule{\csname #1\endcsname}
  52.     \subsection*{#5 Rules}
  53.     }
  54. \gdef\xsep{}
  55. \gdef\xend{}
  56.  
  57. %
  58. % Customization Required for [trule.
  59. % ==================================
  60. %
  61. % The \xpre command defines the TeX formatting to be inserted for an
  62. % empty KB-condition.  In this English form, it does nothing.
  63. %
  64. % The \xif command defines the TeX formatting to be inserted for the
  65. % first non-empty KB-condition.  It takes one argument:
  66. %          #1 - The first non-empty KB-condition
  67. % In this English form, it inserts an "If" and columns) and the
  68. % KB-condition.
  69. %
  70. % The \xand command defines the TeX formatting to be inserted for the
  71. % rest of the KB-conditions.  It takes one argument:
  72. %          #1 - The KB-condition
  73. % In this English form, it insert an "and" and the  KB-condition, if it
  74. % is non-empty.
  75. %
  76. % The \xthen command defines the TeX formatting to be inserted for the
  77. % KB-consequence.  It takes one argument:
  78. %          #1 - The KB-consequence
  79. % In this English form, it inserts a "then", the KB-consequence and a 
  80. % period (.).
  81. %
  82. % See the "The [trule command" subsection of "The Implementation" section
  83. % in the paper for more details.
  84. %
  85. \gdef\xpre{}
  86. \gdef\xif#1{\par {\bf If} \xrel #1}
  87. \gdef\xand#1{\ifx#1\empty\else{\bf and} \xrel #1 \fi }
  88. \gdef\xthen#1{{\bf then} \xrel #1.}
  89.  
  90. %
  91. % Customization Required for [ttext and [trem.
  92. % ============================================
  93. %
  94. % The \xtext command defines the TeX formatting to be inserted for
  95. % arbitrary explanatory text.  It takes one argument:
  96. %          #1 - The explantory text
  97. % In this English form, it prints the text---in italics---as a separate
  98. % paragraph. 
  99. %
  100. % The \xrem command defines the TeX formatting to be inserted for
  101. % extra explanatory text into the tabular form.  It takes one argument:
  102. %          #1 - The extra explantory text
  103. % In this English form, it does nothing.
  104. %
  105. \gdef\xtext#1{\par{\em #1}}
  106. \gdef\xrem#1{}
  107.  
  108.